package com.bbg.amyam.web.flow.service;

import javax.servlet.http.HttpServletRequest;

import org.springframework.webflow.action.MultiAction;
import org.springframework.webflow.execution.RequestContextHolder;

import com.bbg.amyam.domain.model.School;
import com.bbg.amyam.web.util.menu.MenuDescriptor;

public class WebFlowService extends MultiAction {
	
	public MenuDescriptor loadMenuDescriptor() {
		HttpServletRequest request = (HttpServletRequest) RequestContextHolder
				.getRequestContext().getExternalContext().getNativeRequest();
		MenuDescriptor menuDescriptor = (MenuDescriptor) request
				.getAttribute("current_menuDescriptor_obj");
		return menuDescriptor;
	}

	public School loadCurrentSchool() {
		HttpServletRequest request = (HttpServletRequest) RequestContextHolder
				.getRequestContext().getExternalContext().getNativeRequest();
		School currentSchool = (School) request
				.getAttribute("current_school_obj");
		return currentSchool;
	}

}
